package zk.tool;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import zk.tool.ui.AppController;
import zk.tool.util.StageUtil;

public class App extends Application {
    private static final Logger log = LoggerFactory.getLogger(App.class);
    public static AnchorPane root;
    public static Scene scene;
    public static Stage primaryStage;

    @Override
    public void start(Stage primaryStage) throws Exception {
        this.primaryStage = primaryStage;
        // 加载主界面
        FXMLLoader loader = StageUtil.loadFxml("app.fxml");
        root = loader.load();
        AppController appController = loader.<AppController>getController();
        // 初始化菜单
        appController.initMenu();
        // 初始化场景
        scene = new Scene(root, 600, 600);
        primaryStage.setScene(scene);
        primaryStage.setTitle("zk-tool");
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}
